{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "eb4388c5-dca2-432c-8023-b9f9dc714eee",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Michael', 'Bob', 'Tracy']\n"
     ]
    }
   ],
   "source": [
    "classmates = ['Michael', 'Bob', 'Tracy']\n",
    "print(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "49f1de68-ef1f-477a-ba89-8fa44ff8765c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c584ca4c-e66d-4e1d-a668-5b8c28e4d595",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Michael'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classmates[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6a71e1f5-ae59-4ea4-9766-2b41a2b85543",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Tracy'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classmates[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "79f8e7fa-53f5-4f20-9855-82fae6cb615c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Bob'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classmates[-2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "0b1a15a3-2e2a-4e4f-84a3-dd1e6c56bf49",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "list index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[8], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mclassmates\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m]\u001b[49m\n",
      "\u001b[1;31mIndexError\u001b[0m: list index out of range"
     ]
    }
   ],
   "source": [
    "classmates[3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "dcf152f1-5707-4698-bf30-dc14e2c16ee9",
   "metadata": {},
   "outputs": [],
   "source": [
    "classmates.append('thomas')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "c50aeff2-f431-4243-abf6-cfd4aab6773b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Michael', 'Bob', 'Tracy', 'thomas']\n"
     ]
    }
   ],
   "source": [
    "print(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "f8467610-0020-478c-9d8b-7a5a35f4ad1c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Michael', 'Bob', 'Tracy']\n"
     ]
    }
   ],
   "source": [
    "classmates.pop()\n",
    "print(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "1aa50798-981d-4ca5-9eb0-ac2a7da0c771",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Tracy'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classmates.pop(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "679b3c27-1eb3-422d-9cad-0dc50b78e8cf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Bob']\n"
     ]
    }
   ],
   "source": [
    "classmates.pop(0)\n",
    "print(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b04f5f21-8c38-4f33-8e17-4600332fd7c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "L = ['thomas', 12 , True ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "3ce9232a-f616-41fc-81ff-587ace623a57",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['thomas', 12, True]\n"
     ]
    }
   ],
   "source": [
    "print(L)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4c7ca396-c2f7-47f6-a774-46ef18193aba",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('Michael', 'BOb ', 'Tracy')\n"
     ]
    }
   ],
   "source": [
    "#tuple\n",
    "classmates = ('Michael', 'BOb ', 'Tracy')\n",
    "print(classmates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "85602483-e39e-4f66-95ee-979a8f47d955",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "()\n"
     ]
    }
   ],
   "source": [
    "t = ()\n",
    "print(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "0e64590e-df2b-45a7-94a7-c13c456ad9eb",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'tuple' object has no attribute 'append'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[21], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mclassmates\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mappend\u001b[49m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mA\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'"
     ]
    }
   ],
   "source": [
    "classmates.append('A')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "3cd6dd45-fee4-4de6-bf65-d79866836221",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n"
     ]
    }
   ],
   "source": [
    "t = (1) \n",
    "print(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "5a7445fa-142e-4a62-ab9d-5f9ef1c438b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(1,)\n"
     ]
    }
   ],
   "source": [
    "t = (1,) \n",
    "print(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "0686fe43-31a7-4074-bc49-3a6db49df05e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('a', 'b', ['X', 'Y'])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = ('a', 'b', ['A', 'B'])\n",
    "t[2][0] = 'X'\n",
    "t[2][1] = 'Y'\n",
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "561c2835-d054-4e41-a45d-3bbe73f240a5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
